Skip to content

Conversation

@pengweiqhca
Copy link

Fix #88

@Giorgi
Copy link
Owner

Giorgi commented Aug 22, 2025

@pengweiqhca Can you fix the failing tests too?

@Giorgi Giorgi requested a review from Copilot August 27, 2025 13:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds deadlock detection and handling capabilities to the EntityFramework.Exceptions library. The changes introduce a new DeadlockException type and implement deadlock error classification across multiple database providers.

  • Adds DeadlockException class with standard constructors for Entity Framework integration
  • Implements IsDeadlockError method across database-specific exception classifiers (SQL Server, PostgreSQL, Oracle, MySQL)
  • Adds comprehensive test coverage with database-specific test overrides for platforms that don't support deadlock testing

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
EntityFramework.Exceptions/Common/Exceptions.cs Defines the new DeadlockException class with standard EF constructors
EntityFramework.Exceptions/Common/ExceptionProcessorInterceptor.cs Adds deadlock detection to the exception processing pipeline
EntityFramework.Exceptions/Common/ExceptionFactory.cs Maps deadlock database errors to DeadlockException instances
DbExceptionClassifier/Common/IDbExceptionClassifier.cs Adds IsDeadlockError interface method with default implementation
DbExceptionClassifier/*/ExceptionClassifier.cs Implements deadlock error detection for each database provider
EntityFramework.Exceptions/Tests/DatabaseTests.cs Adds deadlock test case and exposes Options property in DemoContext
EntityFramework.Exceptions/Tests/*Tests.cs Overrides deadlock test for SQLite and Oracle with skip attributes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Giorgi
Copy link
Owner

Giorgi commented Aug 28, 2025

@pengweiqhca Are you sure there is no way to cause deadlock in Oracle and SQLite?

@pengweiqhca
Copy link
Author

SQLite does not have deadlocks.

In Oracle, I was unable to reproduce a deadlock in the same scenario, even after waiting until timeout, so I skipped it.

@Giorgi Giorgi changed the base branch from main to Deadlock September 25, 2025 09:16
@Giorgi Giorgi merged commit 7b7ca3d into Giorgi:Deadlock Sep 25, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add IsDeadkockError

2 participants